home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 016a / ebl407px.zip / BATDEMO.BAT < prev    next >
DOS Batch File  |  1992-01-24  |  18KB  |  579 lines

  1. bat * Loading DEMO .....
  2. *           Written by F.Canova 10/5/83 through 01/25/90
  3. *   (c) Copyright 1983-1990 by Seaware Corp. all rights reserved.
  4. *    This batch file REQUIRES EBL PLUS for proper execution!
  5.  
  6. ********************* NOTE! NOTE! NOTE! NOTE! ********************
  7. %D = 'RAM'    |* <-----Change 'RAM' to 'BIOS' if PC isn't 100% IBM Compatible!
  8. goto -start
  9. * For more information or to receive your own copy of EBL PLUS write to:
  10. *              Seaware Corp.
  11. *              P.O. Box 1656
  12. *              Delray Beach, FL 33444
  13.  
  14. *---- FEATURES OF THE LANGUAGE USED WITHIN THIS DEMO ARE: ----------------
  15. * Standard DOS commands can be intermixed freely with BAT commands.
  16. * Up to 255 chars are allowed for labels, contents of vars, and literals
  17. * 10 variables are provided to be passed to/from DOS. They're %0 to %9.
  18. * 15 variables are provided for EBL PLUS┐ user use only. They're %A to %O.
  19. * The variable %R is a return code that any routine can set at [0:04FE]
  20. * BEGTYPE command can have screen attributes via the COLORCHAR command,
  21. * or the '\hex' format.
  22. * BEGSTACK command can have timing attributes via the KEY(PAUSE) or
  23. * the alternative '\hex' format.
  24. * Spaces are not needed to delimit operators.
  25. * Non-spaces will concatenate variables and literals.
  26. * EXIST() and DIR() set a return code based on state of a file's existence.
  27.  
  28.         ** Now actually do the bouncing bar menu **
  29. -End1    type " Exit to DOS                " | If %A = Enter then goto -Bye
  30. -Endit    %A = select( color( yellow on green), color( black on white ), Arrow)
  31.     if %A = Esc then goto -Bye
  32.     if %R = 1 then goto -End1
  33. -End2    if %R = 2 type " Go to on-line documentation" | If %A = Enter then stack "BATDOC" |exit
  34. -End3    if %R = 3 type " Return to EBL Plus demo    " | If %A = Enter then goto -top
  35.        goto -endit
  36.  
  37. -Bye    window( 19, 14, 49, 21)
  38.     type "So long" %F....
  39.     type "P.S. For quickie help,"
  40.     type " just enter 'BAT' from DOS!"
  41.     exit
  42.  
  43. -start
  44.     if %D = 'RAM' then RAM
  45.     else BIOS
  46.  
  47. ** Open the demo with welcome message windows in the shape of a big 'W' **
  48. *   play( o5 t140 ms l8 g4 p >c <b >c p6 <e p6 d p6 b p6 >c..)
  49. *   repeat with %0 = 1 to 27
  50. *    color ((%0 % 8) & "F")
  51. *    if %0 < 7        then %1 = %0 * 2
  52. *       else if %0 < 14  then %1 = (14 - %0) * 2
  53. *       else if %0 < 21  then %1 = (%0 - 13) * 2
  54. *       else          %1 = (28 - %0) * 2
  55. *    window( (%0*2), %1, (%0*2+20), (%1+5), s)
  56. *    type
  57. *    type center("Welcome", 18)
  58. *   end repeat
  59. *   wait until time(2)
  60.  
  61. ** Start by asking who I'm talking to **
  62.     colorchar '=' as color( yellow on white )
  63.     colorchar '@' as color( white on blue )
  64.     colorchar '`' as color( blink white on blue )
  65.     color( black on white )
  66.     cls
  67.     begtype
  68.           =(Non-IBM systems, read NOTE within this file)=
  69.  
  70.   @┌───────────────────────────────────────────────────────────────────────┐@
  71.   @│          EXTENDED BATCH LANGUAGE-PLUS                   │@
  72.   @│                                       │@
  73.   @│    Welcome to the Extended Batch Language Plus Demonstration !       │@
  74.   @│                                       │@
  75.   @└───────────────────────────────────────────────────────────────────────┘@
  76. end
  77. call -asplogo 40 16
  78. color( white on black )
  79. locate 13 10 | Type "What is your first name? ;"
  80. read %F
  81. %7 = 27
  82. %L =
  83. %0 = left( (" " & %F & "'s EBL Plus Sampler Menu"), 47)
  84.  
  85. -top ** Show Master Menu of things that can be shown **
  86.     color( Normal )
  87.     colorchar
  88.     colorchar '@' as color( white on blue )
  89.     colorchar '^' as color( lgray on blue )
  90.     colorchar '#' as color( black on cyan )
  91.     colorchar '&' as color( yellow on red )
  92.     colorchar '*' as color( white on red )
  93.     locate 1 1
  94.     cls begtype
  95. @════════════════════════════════════════════════@ ^┌─────────────────────────┐^
  96. @ \%0@ ^│ User supported software │^
  97. @════════════════════════════════════════════════@ ^│           by          │^
  98.                            ^│                  │^
  99.                            ^│ Seaware Corp.          │^
  100.  # S #────&Display Screen and String operations  & ^│ P.O. Box 1656          │^
  101.       *                     * ^│ Delray Beach, FL 33444  │^
  102.  # D #────&Directory of available programs     & ^│ 407/738-1712          │^
  103.       *                     * ^│                  │^
  104.  # F #────&Testing for Files             & ^│ Order your registered   │^
  105.       *                     * ^│ copy for $79 from us    │^
  106.  # K #────&Keyboard stack (the invisible fingers)& ^│ directly or our order   │^
  107.       *                     * ^│ line at 800/634-8188    │^
  108.  # C #────&I can Count                 & ^│                  │^
  109.       *                     * ^│ Please copy and share   │^
  110.  # X #────&eXit                  & ^│ BAT.COM, BATDOC.BAT,    │^
  111.                            ^│ and BATDEMO.BAT for     │^
  112.                            ^│ non-commercial uses     │^
  113.                            ^│ only.              │^
  114.                            ^│                  │^
  115.                            ^│ ASP member.          │^
  116. (Select a demo with the cursor and press ─┘)       ^└─────────────────────────┘^
  117. end
  118.     colorchar
  119.     colorchar '@' as color( white on blue )
  120. -Entry
  121.     color( yellow on black)
  122.     %9 = ''
  123.  
  124. -Text.1 *** (C)ount
  125.     locate 1 18
  126.     type " See how EBL Plus makes your screen come alive"
  127.     type " with color and powerful string handling.     "
  128.     if %9 = Enter then call -sgo | goto -top
  129.  
  130. -Choose
  131.     %7 = %7 + 3
  132.     %9 = select(color(yellow on red),color(black on white),Arrow)
  133.  
  134.     if %9 = 'C' then %9 = Enter
  135.     if %9 = 'D' then %9 = Enter
  136.     if %9 = 'F' then %9 = Enter
  137.     if %9 = 'K' then %9 = Enter
  138.     if %9 = 'S' then %9 = Enter
  139.     if %9 = 'X' then %9 = Enter
  140.     locate 1 18
  141.     if %R = 1 then goto -Text.1
  142.     if %R <> 2 then skip 4
  143.     type " See how EBL Plus can work together with your "
  144.     type " application and DOS.                         "
  145.     if %9 = Enter then call -dgo | goto -top
  146.           else goto -Choose
  147.     if %R <> 3 then skip 4
  148.     type " EBL Plus can see files that are created by   "
  149.     type " your programs, or create new ones on it own. "
  150.     if %9 = Enter then call -fgo | goto -top
  151.           else goto -Choose
  152.     if %R <> 4 then skip 4
  153.     type " EBL Plus can automatically control your      "
  154.     type " applications by typing on the keyboard.      "
  155.     if %9 = Enter then call -kgo | goto -top
  156.           else goto -Choose
  157.     if %R <> 5 then skip 4
  158.     type " This is a simple game that shows the math    "
  159.     type " and looping capabilities of EBL Plus.        "
  160.     if %9 = Enter then call -i.can.count | goto -top
  161.           else goto -Choose
  162.     else
  163.     type " Leave this Demo and return to DOS            "
  164.     type "                                              "
  165.     if %9 = Enter then goto -exit
  166.           else goto -Choose
  167.  
  168. *******************************************************************************
  169.  
  170. * number guessing demo *
  171. -i.can.count
  172.     cls type "I am thinking of a two digit number, can you guess it?"
  173.     %J=tries
  174.     %7 = right(%7,2) + 0        |* Limit to just 2 digits!
  175.     repeat with %A = 4 down to 0
  176.     read %5
  177.     if %5 = %7
  178.     begin
  179.         type "Great!  I was afraid you weren't going to get it!"
  180.         exit repeat
  181.     end
  182.     if %A = 1 then %J = try
  183.     if %A = 0
  184.     begin
  185.         type "BOO HISSS!  The number was" %7 "!"
  186.         exit repeat
  187.     end
  188.     if %5 > %7 type "Try a little lower.  You get" %A "more" %J.
  189.     if %5 < %7 type "Try a higher number.  You get" %A "more" %J.
  190.     end repeat
  191.     begtype
  192. @════════════════════════════════════════════════════════════════════════════@
  193.   A BAT program can create loops and count events.  With this you can
  194.   sequence through file numbers, or create loops to do retries in case of
  195.   errors.  The REPEAT commands are handy for this.  EBL programs can even
  196.   do arithmetic (up to 18 digits) and string manipulation (up to 255
  197.   characters mixed case).
  198. @════════════════════════════════════════════════════════════════════════════@
  199.  
  200. Press any key to continue. . .
  201.  
  202. end
  203. inkey
  204. return
  205.  
  206. *******************************************************************************
  207.  
  208. * directory demo *
  209. -dgo
  210.     color( White )
  211.     cls
  212.     type "Enter file.spec for files you would like to see,"
  213.     read or press ENTER for all: %1
  214.     if .%1 = '.' then %1 = '*.*'
  215.     -dirques
  216.     colorchar . as color( yellow on black )
  217.     type "Would you like a .S.tandard or .W.ide directory?"
  218.     select( color(yellow on black))
  219.     colorchar .
  220.     if %R = 2 then %3 = '/w'
  221.        else %3 =
  222.     cls
  223.     type "EBL Plus can work directly with your applications or DOS."
  224.     type "For example, two values are passed to DOS here: %1 and %3"
  225.     shell dir %1 %3 /p
  226.     shell pause
  227.     cls
  228.     begtype
  229. @═════════════════════════════════════════════════════════════════════════@
  230.   This directory was created using the 'DIR' DOS command within this
  231.   batch file.  Any DOS commands can be mixed freely within lines of the
  232.   BAT program and are shelled by default.  Here, to insure EBL understood
  233.   it to be a DOS command, rather than it's own 'DIR' command, another
  234.   'SHELL' was placed before the DOS command.  Alternately, the 'LEAVE'
  235.   command could have been used.  By passing parameters to and from DOS,
  236.   you can have complete control of how a program operates.  User programs
  237.   may also set a return code in order to control batch file execution.
  238. @═════════════════════════════════════════════════════════════════════════@
  239.  
  240. Press any key to continue. . .
  241.  
  242. end
  243. inkey
  244. return
  245.  
  246. *******************************************************************************
  247.  
  248. *files demo
  249. -fgo
  250.     cls type Enter a file name to search.
  251.     read %E
  252.     -is.f if .%E = '.' then goto -fgo
  253.     type Scanning for file: %E . . .
  254.     * this will set the return code up (%R)
  255.     if exist( %E ) then type The file does exist - exactly as typed.
  256.     else
  257.     begin
  258.      type The file does not exist in the current subdirectory.
  259.      -srch
  260.          type Would you like to search another subdirectory
  261.          read or drive (y/n)? %B
  262.          if %B <> y then if %B <> n goto -srch
  263.          if %B <> y then cls | skip 5
  264.      -is.f2
  265.          cls type "Enter path and filename (ex. c:\subdir\filename.ext):"
  266.          read %E
  267.          if .%E = '.' then goto -is.f2
  268.          goto -is.f
  269.     end
  270.     begtype
  271.  
  272. @═══════════════════════════════════════════════════════════════════════════@
  273.       File searching is done by the commands called DIR and EXIST.
  274.  
  275.   If the file was there, we could direct a program to use it, even if it
  276.   wasn't on the specific diskette drive that the operator was expecting.
  277.  
  278.   If the file was not there, we could have printed out an error message
  279.   to the operator, or we could have run an alternate program in order to
  280.   create the missing file.
  281.  
  282.   Extended Batch Language Plus┐ can also read and write files.    This is
  283.   useful for making configuration files, setting up printers, etc.
  284. @═══════════════════════════════════════════════════════════════════════════@
  285.  
  286. Press any key to continue . . .
  287.  
  288. end
  289. inkey
  290. return
  291.  
  292. *******************************************************************************
  293.  
  294. * keyboard stack demo
  295. -kgo
  296. cls begtype
  297.  
  298. ╔═════════════════════════════════════════════════════════════════════════════╗
  299. ║                                          ║
  300. ║    The keyboard stack can answer questions to programs automatically.       ║
  301. ║    For example, this DOS command is being answered by the keyboard stack.   ║
  302. ║                                          ║
  303. ╚═════════════════════════════════════════════════════════════════════════════╝
  304. end
  305. begstack
  306. This text is actually being typed for you from the keyboard stack.
  307. All keys, including control keys and function keys can come from this stack.
  308. end
  309.     key( "Keystrokes can" )
  310.     key(pause)
  311.     key( " even" )
  312.     key(pause)
  313.     key( " have" )
  314.     key(pause)
  315.     key( " delayed" )
  316.     key(pause)
  317.     key( " typing. " )
  318.     Key(ctrl-z)
  319.     key(enter)
  320.     stack.on  |* This makes sure copy can see our stack contents.
  321.     * Below is the DOS command that will read the keyboard stack. *
  322. copy con: nul:
  323. begtype
  324.  
  325. Press any key to continue. . .
  326.  
  327. end
  328. inkey
  329. return
  330.  
  331. *******************************************************************************
  332. * screen attributes and strings demo
  333. -sgo
  334. colorchar '^' as color( high-intensity on black )
  335. colorchar '~' as color( red on black )
  336. colorchar '`' as color( blue on green )
  337. colorchar '&' as color( Blink LMagenta on Black )
  338. cls begtype
  339. ╔═════════════════════════════════════════════════════════════════════════════╗
  340. ║    All sorts of screen attributes can be printed on the screen.          ║
  341. ║                                          ║
  342. ║   On monochrome display you see:          On color display you see:       ║
  343. ╚═════════════════════════════════════════════════════════════════════════════╝
  344.     ~Normal                   Red on Black~
  345.     ^High Intensity               High Intensity^
  346.     `Underlined                  Blue on Green`
  347.     &Blinking Normal              Blinking Light Magenta on Black&
  348.  
  349.             And many @other@ \84comb\82inat\84ions\07^!^
  350.  
  351.       ~Colors can even be ^nested^ or toggled `on` and `off`.~
  352. ╔═════════════════════════════════════════════════════════════════════════════╗
  353. ║   EBL PLUS  allows this control of screen attributes through the use of     ║
  354. ║   the COLORCHAR command.  Colors can be nested, toggled, turned off          ║
  355. ║   individually or as a group.  The alternative \\hex format can still        ║
  356. ║   be used as well.                                  ║
  357. ╚═════════════════════════════════════════════════════════════════════════════╝
  358. end
  359. colorchar
  360. colorchar '@' as color( white on blue )
  361. ansi
  362. color yellow on cyan
  363. begtype
  364. Users of ANSI.SYS can also control colors & the display.
  365.  
  366. Press any key to continue. . .
  367.  
  368. end
  369. color normal
  370. inkey
  371. IF %D = 'RAM' then RAM
  372. else BIOS
  373. cls
  374.     colorchar
  375.     color white on red
  376.     window(1,1,80,25,s)
  377.     type center("Window() function demonstration",78)
  378.  
  379.     color gray on blue
  380.  
  381.     window( 2,3,19,10 )
  382.     type "Default"
  383.     type "border"
  384.  
  385.     color red  on blue
  386.     window( 21,3,39,10,B )
  387.     type "Blank"
  388.     type "border"
  389.  
  390.     color yellow on blue
  391.     window( 41,3,59,10,S )
  392.     type "Single"
  393.     type border
  394.  
  395.     color cyan   on blue
  396.     window( 61,3,79,10,D )
  397.     type Double
  398.     type border
  399.  
  400.     color green
  401.     window( 2,12,25,24,3 )
  402.     type "3D border"
  403.  
  404.     color yellow on cyan
  405.     window( 60,12,70,14,b)
  406.     type center("Buttons",8)
  407.  
  408.     color red on black
  409.     window( 30,12,55,24,H )
  410.     color cyan
  411.     play( o5 t140 ms l8 g4 p >c <b >c p6 <e p6 d p6 b p6 >c..)
  412. BEGTYPE
  413.  
  414. Windows,
  415.   Colors,
  416.     and Sound...
  417.  
  418. makes your screens
  419.  
  420. come \8ealive\0e!!
  421.  
  422. END
  423.     inkey
  424.     color yellow on cyan
  425.     window( 15,5,65,15 )
  426.     colorchar '&' as color( Bright white on cyan )
  427.     begtype
  428.  
  429. ----- And Bouncing Bar Menus are a Snap! ------
  430.  
  431.     &     Continue with demo...        &
  432.  
  433.     &     Return to main menu...     &
  434.  
  435.     &     Exit.                &
  436. end
  437.     Select(color( Bright white on cyan ) )
  438.     if %R = 2 then goto -top
  439.     if %R = 3 then cls exit
  440.  
  441. -rd.name1
  442.     color( yellow )
  443.     colorchar
  444.     colorchar '@' as color( white on blue )
  445.     cls
  446.     if .%F <> '.' skip 3
  447.     * notice a '.' will make sure that null entries can be found
  448.     read I didn't catch your first name, what was it? %F
  449.     goto -rd.name1
  450.     type OK, your first name is %F
  451.     -rd.name2
  452.     if .%L <> '.' skip 2
  453.     read I didn't catch your last name, what was it? %L
  454.     goto -rd.name2
  455.     cls begtype
  456.  
  457. I am using your name as two strings to work with.
  458.  
  459. end
  460. type Strings contents can be manipulated . . .
  461. type CONCATENATION.. They can be combined to form %F%L
  462. type CENTERING...... Center(%F,40,'-')
  463. type "TRANSLATING.... Reverse(" reverse(%F) "), Upper(" upper(%F) "), Copies(" copies(%F,2) ")"
  464. /U | %I = %F $ 1 1
  465. %I = %I.%L $ 1 3   | /U-
  466. %H = %F #
  467. type SUBSTRINGS..... Your initials would be %I.
  468. type LENGTHS........ Your first name has %H letters.
  469. type ...and much more!
  470. begtype
  471.  
  472. @════════════════════════════════════════════════════════════════════════════@
  473.   Strings can be up to 255 characters and may be passed back and forth
  474.   to DOS.  Flexible string operations and comparisons can be done as well.
  475.   There are 10 variables for strings which may operate with DOS, and 15
  476.   which can be used even between executing BAT programs.  There are another
  477.   6 variables which have predefined (fixed) contents to give status, etc.
  478. @════════════════════════════════════════════════════════════════════════════@
  479.  
  480. Press any key to continue. . .
  481. end
  482. inkey
  483. return
  484.  
  485. *******************************************************************************
  486.  
  487. -exit    ********** Display final EXIT window ***********
  488.     locate 11 16            |* erase old bounce bar
  489.     color( yellow on red)
  490.     type " eXit                                   "
  491.  
  492.     color( white on blue )        |* setup new window w/ bounce bar
  493.     window( 18, 13, 48, 20)
  494.     type "Ready to leave EBL Plus demo!"
  495.     color Cyan on blue
  496.     type "Make selection & press ─┘"
  497.     type
  498.     colorchar . as color( yellow on green)
  499.     type ". Exit . . Help . .Return."
  500.     colorchar
  501.     %A = ""
  502.     goto -End1
  503.  
  504. *******************************************************************************
  505.  
  506. bat -on.error-
  507. bat begtype
  508.  
  509.     Unexpected error \%S%R in line \%S%L !
  510.  
  511.     This batch file was error free when it was distributed
  512.     by Seaware. An error indicates that it was most likely
  513.     modified by someone improperly. To get an updated demo
  514.     diskette send $10 to Seaware directly or call 800/634-8188.
  515.  
  516.  
  517.  
  518.                Seaware Corp.
  519.            Post Office Box 1656
  520.            Delray Beach, FL 33444
  521. end
  522. exit
  523.  
  524. ***  Built Animated ASP Logo ***
  525. *   (Caution: Use of this routine is restricted to registered ASP Members only!)
  526. *
  527. -asplogo
  528. read %M %N
  529. *
  530. *  %M = logo x corner
  531. *  %N = logo y corner
  532. *
  533. *color( white on blue )
  534. window(%M,%N,(%M+39),(%N+10),b)
  535. begtype
  536.            (tm)
  537.  
  538. ─────────────────────────────────────
  539.  
  540.  
  541.  
  542. ─────────────────────────────────────
  543. end
  544. wait until time(1)
  545. window((%M+9),(%N+1),(%M+19),(%N+5),s)
  546. begtype
  547.  
  548.     o
  549.     ║
  550. ────╨
  551. end
  552. locate (%M+22) (%N+4) | type "Association of"
  553. wait until time(1)
  554. window((%M+3),(%N+2),(%M+13),(%N+6),s)
  555. begtype
  556.  
  557.     o
  558.     ║
  559. ────╨
  560. end
  561. locate (%M+9)  (%N+2) | type "┴"
  562. locate (%M+22) (%N+5) | type "Shareware"
  563. wait until time(1)
  564. window((%M+7),(%N+4),(%M+17),(%N+8),s)
  565. begtype
  566.  
  567.     o
  568.     ║
  569. ────╨
  570. end
  571. locate (%M+13) (%N+4) | type "┴╨"
  572. locate (%M+17) (%N+5) | type "├"
  573. locate (%M+7)  (%N+6) | type "┤"
  574. locate (%M+22) (%N+6) | type "Professionals"
  575. wait until time(1)
  576. locate (%M+22) (%N+8) | type "MEMBER"
  577. wait until time(1)
  578. return
  579.